home *** CD-ROM | disk | FTP | other *** search
- 10! The following is a test of the HTBasic math "runtime"
- 20! libary function: F_pareto
- 30! File: F_pareto.prg
- 50! Comments: Probability density for Pareto distribution.
- 60 CLEAR SCREEN
- 70 LOADSUB ALL FROM "..\mathlib\Mathlib.hts"
- 80 GINIT
- 90 Function$="F_pareto"
- 100 X_left=1
- 110 X_right=5
- 120 Y_bottom=0
- 130 Y_top=2
- 140 X_tick=1
- 150 Y_tick=.5
- 160 Xo=1
- 170 T=2
- 180 Precision=.1
- 190 PRINT Function$,"example"
- 200 PRINT "x, y"
- 210 VIEWPORT 40,120,20,90
- 220 WINDOW X_left,X_right,Y_bottom,Y_top
- 230 FRAME
- 240 AXES X_tick,Y_tick
- 250 PEN 6
- 260! Draw graph
- 270 FOR Loop=X_left TO X_right STEP Precision
- 280 PLOT Loop,FNF_pareto(Xo,T,Loop)
- 290 IF Loop MOD X_tick=0 THEN
- 300 PRINT Loop,FNF_pareto(Xo,T,Loop) ! place function here.
- 310 END IF
- 320 NEXT Loop
- 330! Draw labels
- 340 CSIZE 3
- 350 PEN 1
- 360 FOR Loop=X_left TO X_right STEP X_tick
- 370 MOVE Loop,0
- 380 LABEL Loop
- 390 NEXT Loop
- 400 FOR Loop=Y_bottom TO Y_top STEP Y_tick
- 410 MOVE 0,Loop
- 420 LABEL Loop
- 430 NEXT Loop
- 440 DELSUB FNAi TO END
- 450 END
-